package com.mengdie.shuidi.ui.adapter;

import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.mengdie.shuidi.R;
import com.mengdie.shuidi.model.ModelProvince;

import java.util.List;

/**
 * 作者：HQY on 17/8/21 18:16
 * 邮箱：hqy_xz@126.com
 */

public class ModelProvinceAdapter extends BaseQuickAdapter<ModelProvince, BaseViewHolder> {


    public ModelProvinceAdapter(List<ModelProvince> data) {
        super(R.layout.item_model_province, data);
    }


    @Override
    protected void convert(BaseViewHolder helper, ModelProvince item) {
        TextView mTvProvince = helper.getView(R.id.tv_proinvce_name);
        mTvProvince.setText(item.getRegion());
        if (item.isShow()) {
            mTvProvince.setBackgroundColor(mContext.getResources().getColor(R.color.package_name));
            mTvProvince.setTextColor(mContext.getResources().getColor(R.color.color_white));
        } else {
            mTvProvince.setBackgroundColor(mContext.getResources().getColor(R.color.color_white));
            mTvProvince.setTextColor(mContext.getResources().getColor(R.color.color_222222));
        }
    }
}
